package com.xsy.android.compose.wandroid.ui.page.login.view

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.width
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@Composable
fun TextFieldError(modifier: Modifier = Modifier, textError: String) {
    Row(modifier = modifier.fillMaxWidth()) {
        Spacer(modifier = modifier.width(16.dp))
        Text(
            text = textError,
            modifier = modifier.fillMaxWidth(),
            style = LocalTextStyle.current.copy(color = MaterialTheme.colorScheme.error)
        )
    }

}


@Preview
@Composable
private fun PreviewTextFieldError() {
    TextFieldError(textError = "error")
}